class lzu::nfsclient{
  include autofs

  file {"/etc/auto.master.d/local.autofs":
    mode    =>  '644',
    owner   =>  'root',
    group   =>  'root',
    #source =>  "puppet:///modules/${module_name}/local.autofs",
    content => '/- /etc/auto.local --timeout=120'
  }->
  
  autofs::mapfile { 'lzu':
    path     => '/etc/auto.local',
    mappings => [
      { 'key' => '/home', 'options' => 'fstype=nfs,rw,soft,intr', 'fs' => '192.168.1.100:/home' },
      { 'key' => '/data', 'options' => 'fstype=nfs,rw,soft,intr', 'fs' => '192.168.1.100:/data' },
      { 'key' => '/data2', 'options' => 'fstype=nfs,rw,soft,intr', 'fs' => '192.168.1.112:/data2' },
      { 'key' => '/publicfs', 'options' => 'fstype=nfs,rw,soft,intr', 'fs' => '192.168.1.113:/publicfs' },
      { 'key' => '/publicfs2', 'options' => 'fstype=nfs,rw,soft,intr', 'fs' => '192.168.1.113:/publicfs2' },
    ]
  }
  #autofs
  augeas { "autofs_conf":
    context => "/files/etc/autofs.conf/autofs",
    changes => [
      "set browse_mode yes",
    ],
  }
}
